"""
@name : 计算复利.py
@anthor : huyuxuan
@projectname : PycharmProjects
"""
money = int(input("请输入要存入的金额："))
amount = int(input("请输入目标金额："))
i = 1
while i > 0:
    interest = money * 0.05
    money += interest
    print("第%d年的本金加利息为%.2f元" % (i,money))
    i += 1
    if money >= amount:
        print(f"一共需要{i-1}年,本金加利息能够达到{amount}元")
        break